package com.glodon.paas.account.web.util;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

/**
 * @author Don Li
 */
public class CookieUtils {
    public static String getValue(String name, HttpServletRequest request) {
        String value = null;
        Cookie[] cookies = request.getCookies();
        if(cookies != null){
        	for (Cookie cookie : cookies) {
        		if (name.equals(cookie.getName())) {
        			value = cookie.getValue();
        			break;
        		}
        	}
        }
        return value;
    }
}
